<?php
//后台用户的列表
class MemberControl extends CommonControl{
	public function index(){
		
		//获得数据库的数据
		$sql = "SELECT *FROM hd_user";
		$member = M('wenda')->query($sql);
		// var_dump($data);
		// $member= 'wqk joiaf';
		$this->assign('member',$member);
		$this->display('user_list');
	}
	//指定管理员 *************************************
	public function point_message(){
		$username = $_GET['username'];
		//拼合SQL
		$sql = "UPDATE hd_user SET power =0 WHERE username='{$username}'";
		//插入数据
			$uid =M('wenda')->exe($sql);
			//判断
			if($uid>0){
				$this->success('指定成功','admin.php?c=Member');

			}else{
				$this->error('指定失败');
			}
		

	}
	//Member *************************************
	public function point_member(){
	$username = $_GET['username'];
		//拼合SQL
		$sql = "UPDATE hd_user SET power =6 WHERE username='{$username}'";
		//插入数据
			$uid =M('wenda')->exe($sql);
			//判断
			if($uid>0){
				$this->success('指定成功','admin.php?c=Member');

			}else{
				$this->error('指定失败');
			}
		

	}
	
}